export default class DownLoadFile {
  static downLoadFile(link, name) {
    if (navigator.userAgent.indexOf('Firefox') > 0) {
      const iframe = document.createElement('iframe');
      iframe.style.display = 'none';
      iframe.src = link;
      document.body.appendChild(iframe);
    } else {
      const aDom = document.createElement('a');
      if (name) {
        aDom.download = name;
      }
      aDom.href = link;
      aDom.click();
    }
  }
}
